package com.atguigu.tms.mock.mapper;

import com.atguigu.tms.mock.bean.ExpressCourier;
import com.atguigu.tms.mock.mapper.adv.AdvMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 快递员表 Mapper 接口
 * </p>
 *
 * @author zhangchen
 * @since 2022-03-20
 */
public interface ExpressCourierMapper extends AdvMapper<ExpressCourier> {


    @Select("select ec.* from express_courier ec , express_courier_complex cc " +
            "where ec.emp_id=cc.courier_emp_id and ec.express_type =#{expressType}  and cc.complex_id =#{complexId}")
    public ExpressCourier selectExpressCourierByComplexId(@Param("expressType") String expressType,
                                                          @Param("complexId") Long complexId);

    @Select("select ec.*,cc.complex_id from express_courier ec , express_courier_complex cc " +
            "where ec.emp_id=cc.courier_emp_id and ec.express_type =#{expressType}   ")
    public List<ExpressCourier> selectExpressCourierWithComplexId(@Param("expressType") String expressType );

}
